prompt PL/SQL Developer import file
set feedback off
set define off
prompt Dropping DQ_META_COLUMN...
drop table DQ_META_COLUMN cascade constraints;
prompt Dropping DQ_META_DENORM_TARGET...
drop table DQ_META_DENORM_TARGET cascade constraints;
prompt Dropping DQ_META_DEPENDENCY...
drop table DQ_META_DEPENDENCY cascade constraints;
prompt Dropping DQ_META_DEPENDENCY_TYPE...
drop table DQ_META_DEPENDENCY_TYPE cascade constraints;
prompt Dropping DQ_META_DEP_COL_ASSIGN...
drop table DQ_META_DEP_COL_ASSIGN cascade constraints;
prompt Dropping DQ_META_DEP_COL_JOIN_ASSIGN...
drop table DQ_META_DEP_COL_JOIN_ASSIGN cascade constraints;
prompt Dropping DQ_META_DEP_ITER_ASSIGN...
drop table DQ_META_DEP_ITER_ASSIGN cascade constraints;
prompt Dropping DQ_META_DEP_TAB_ASSIGN...
drop table DQ_META_DEP_TAB_ASSIGN cascade constraints;
prompt Dropping DQ_META_DEP_TAB_JOIN_ASSIGN...
drop table DQ_META_DEP_TAB_JOIN_ASSIGN cascade constraints;
prompt Dropping DQ_META_RUN...
drop table DQ_META_RUN cascade constraints;
prompt Dropping DQ_META_RUN_ITERATION...
drop table DQ_META_RUN_ITERATION cascade constraints;
prompt Dropping DQ_META_SCHEMA...
drop table DQ_META_SCHEMA cascade constraints;
prompt Dropping DQ_META_SITE...
drop table DQ_META_SITE cascade constraints;
prompt Dropping DQ_META_TABLE...
drop table DQ_META_TABLE cascade constraints;
prompt Dropping DQ_META_TARGET_STAR_JOIN...
drop table DQ_META_TARGET_STAR_JOIN cascade constraints;
prompt Dropping DQ_META_VARIABLE...
drop table DQ_META_VARIABLE cascade constraints;
prompt Dropping S_ORDER...
drop table S_ORDER cascade constraints;
prompt Dropping S_ORDER_DETAILS...
drop table S_ORDER_DETAILS cascade constraints;
prompt Dropping T_DIM_PRODUCT...
drop table T_DIM_PRODUCT cascade constraints;
prompt Dropping T_DIM_PRODUCTGROUP...
drop table T_DIM_PRODUCTGROUP cascade constraints;
prompt Dropping T_FACT_ORDER...
drop table T_FACT_ORDER cascade constraints;
prompt Creating DQ_META_COLUMN...
create table DQ_META_COLUMN
(
  ID          NUMBER,
  TABLE_ID    NUMBER,
  NAME        VARCHAR2(200),
  "DATATYPE"    VARCHAR2(200),
  VARIABLE_YN VARCHAR2(1)
)
;

prompt Creating DQ_META_DENORM_TARGET...
create table DQ_META_DENORM_TARGET
(
  H3_ID                 VARCHAR2(1000),
  H3_MAIN_ORDERID       VARCHAR2(1000),
  H3_PRICE              VARCHAR2(1000),
  H3_ORDERDATE          VARCHAR2(1000),
  H3_PRODUCTSTATUS      VARCHAR2(1000),
  H4_ID                 VARCHAR2(1000),
  H4_ORDER_ID           VARCHAR2(1000),
  H4_PRODUCT_NAME       VARCHAR2(1000),
  H4_PRODUCT_GROUP_ID   VARCHAR2(1000),
  H4_SOLD_DATE          VARCHAR2(1000),
  H5_ID                 VARCHAR2(1000),
  H5_PRODUCT_GROUP_NAME VARCHAR2(1000)
)
;

prompt Creating DQ_META_DEPENDENCY...
create table DQ_META_DEPENDENCY
(
  ID           NUMBER,
  NAME         VARCHAR2(255),
  AUTHOR       VARCHAR2(255),
  CREATIONDATE DATE,
  TYPE_ID      NUMBER,
  ORDER_ID     NUMBER
)
;

prompt Creating DQ_META_DEPENDENCY_TYPE...
create table DQ_META_DEPENDENCY_TYPE
(
  ID   NUMBER,
  NAME VARCHAR2(255)
)
;

prompt Creating DQ_META_DEP_COL_ASSIGN...
create table DQ_META_DEP_COL_ASSIGN
(
  ID            NUMBER,
  COLUMN_ID     NUMBER,
  DEPENDENCY_ID NUMBER,
  SITE_ID       NUMBER,
  DEP_TABLE_ID  NUMBER
)
;

prompt Creating DQ_META_DEP_COL_JOIN_ASSIGN...
create table DQ_META_DEP_COL_JOIN_ASSIGN
(
  ID               NUMBER,
  SOURCE_COLUMN_ID NUMBER,
  TARGET_COLUMN_ID NUMBER
)
;

prompt Creating DQ_META_DEP_ITER_ASSIGN...
create table DQ_META_DEP_ITER_ASSIGN
(
  ID            NUMBER not null,
  DEPENDENCY_ID NUMBER not null,
  ITERATION_ID  NUMBER not null
)
;

prompt Creating DQ_META_DEP_TAB_ASSIGN...
create table DQ_META_DEP_TAB_ASSIGN
(
  ID            NUMBER,
  TABLE_ID      NUMBER,
  DEPENDENCY_ID NUMBER,
  SITE_ID       NUMBER
)
;

prompt Creating DQ_META_DEP_TAB_JOIN_ASSIGN...
create table DQ_META_DEP_TAB_JOIN_ASSIGN
(
  ID                        NUMBER,
  PRIMARY_TABLE_ID          NUMBER,
  SECONDARY_TABLE_ID        NUMBER,
  PRIMARY_TABLE_COLUMN_ID   NUMBER,
  SECONDARY_TABLE_COLUMN_ID NUMBER
)
;

prompt Creating DQ_META_RUN...
create table DQ_META_RUN
(
  ID         NUMBER not null,
  START_DATE DATE not null
)
;

prompt Creating DQ_META_RUN_ITERATION...
create table DQ_META_RUN_ITERATION
(
  ID               NUMBER,
  RUN_ID           NUMBER,
  ITERATION_NUMBER NUMBER
)
;

prompt Creating DQ_META_SCHEMA...
create table DQ_META_SCHEMA
(
  ID       NUMBER not null,
  NAME     VARCHAR2(255) not null,
  DATATYPE VARCHAR2(255)
)
;
alter table DQ_META_SCHEMA
  add constraint PK_SCHEMA_ID primary key (ID);

prompt Creating DQ_META_SITE...
create table DQ_META_SITE
(
  ID   NUMBER,
  NAME VARCHAR2(255)
)
;

prompt Creating DQ_META_TABLE...
create table DQ_META_TABLE
(
  SCHEMA_ID NUMBER,
  NAME      VARCHAR2(200),
  ID        NUMBER,
  PRIMARY   VARCHAR2(200)
)
;

prompt Creating DQ_META_TARGET_STAR_JOIN...
create table DQ_META_TARGET_STAR_JOIN
(
  ID                        NUMBER,
  PRIMARY_TABLE_ID          NUMBER,
  SECONDARY_TABLE_ID        NUMBER,
  PRIMARY_TABLE_COLUMN_ID   NUMBER,
  SECONDARY_TABLE_COLUMN_ID NUMBER,
  ORDER_ID                  NUMBER
)
;

prompt Creating DQ_META_VARIABLE...
create table DQ_META_VARIABLE
(
  ID       NUMBER,
  VALUE    VARCHAR2(200),
  DATATYPE VARCHAR2(200)
)
;

prompt Creating S_ORDER...
create table S_ORDER
(
  ORDERID   NUMBER(4),
  PRICE     VARCHAR2(255),
  CUSTOMER  VARCHAR2(255),
  ORDERDATE DATE
)
;

prompt Creating S_ORDER_DETAILS...
create table S_ORDER_DETAILS
(
  ORDERITEMID  NUMBER(4),
  ORDERID      NUMBER(4),
  PRODUCT_NAME VARCHAR2(255),
  QUANTITY     NUMBER(4),
  PAYMENT      VARCHAR2(255)
)
;

prompt Creating T_DIM_PRODUCT...
create table T_DIM_PRODUCT
(
  DQ_META_ID       NUMBER(15),
  SOLD_DATE        DATE,
  ORDER_ID         NUMBER(4),
  PRODUCT_NAME     VARCHAR2(255),
  PRODUCT_GROUP_ID NUMBER(4),
  ID               NUMBER(4)
)
;

prompt Creating T_DIM_PRODUCTGROUP...
create table T_DIM_PRODUCTGROUP
(
  DQ_META_ID         NUMBER(15),
  ID                 NUMBER(4),
  PRODUCT_GROUP_NAME VARCHAR2(255)
)
;

prompt Creating T_FACT_ORDER...
create table T_FACT_ORDER
(
  DQ_META_ID    NUMBER(15),
  ID            NUMBER(4),
  PRICE         VARCHAR2(255),
  ORDERDATE     DATE,
  PRODUCTSTATUS VARCHAR2(255),
  MAIN_ORDERID  NUMBER(4)
)
;


CREATE SEQUENCE  "DQ_META_RUN_SEQ"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE  NOORDER  NOCYCLE ;
CREATE SEQUENCE  "DQ_META_RUN_ITERATION_SEQ"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE  NOORDER  NOCYCLE ;
CREATE SEQUENCE  "DQ_META_DEP_ITER_ASSIGN_SEQ"  MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE  NOORDER  NOCYCLE ;



CREATE OR REPLACE TRIGGER dq_meta_dep_iter_assign_trg
  BEFORE INSERT
  ON dq_meta_dep_iter_assign
  FOR EACH ROW
  -- Optionally restrict this trigger to fire only when really needed
  
when (new.id is null)
DECLARE
  v_id dq_meta_dep_iter_assign.id%TYPE;
BEGIN
  -- Select a new value from the sequence into a local variable. As David
  -- commented, this step is optional. You can directly select into :new.qname_id
  SELECT dq_meta_dep_iter_assign_seq.nextval INTO v_id FROM DUAL;

  -- :new references the record that you are about to insert into qname. Hence,
  -- you can overwrite the value of :new.qname_id (qname.qname_id) with the value
  -- obtained from your sequence, before inserting
  :new.id := v_id;
END my_trigger;
/

CREATE OR REPLACE TRIGGER dq_meta_run_iteration_trg
  BEFORE INSERT
  ON dq_meta_run_iteration
  FOR EACH ROW
  -- Optionally restrict this trigger to fire only when really needed
  
when (new.id is null)
DECLARE
  v_id dq_meta_run_iteration.id%TYPE;
BEGIN
  -- Select a new value from the sequence into a local variable. As David
  -- commented, this step is optional. You can directly select into :new.qname_id
  SELECT dq_meta_run_iteration_seq.nextval INTO v_id FROM DUAL;

  -- :new references the record that you are about to insert into qname. Hence,
  -- you can overwrite the value of :new.qname_id (qname.qname_id) with the value
  -- obtained from your sequence, before inserting
  :new.id := v_id;
END my_trigger;
/
CREATE OR REPLACE TRIGGER dq_meta_run_trg
  BEFORE INSERT
  ON dq_meta_run
  FOR EACH ROW
  -- Optionally restrict this trigger to fire only when really needed
  
when (new.id is null)
DECLARE
  v_id dq_meta_run.id%TYPE;
BEGIN
  -- Select a new value from the sequence into a local variable. As David
  -- commented, this step is optional. You can directly select into :new.qname_id
  SELECT dq_meta_run_seq.nextval INTO v_id FROM DUAL;

  -- :new references the record that you are about to insert into qname. Hence,
  -- you can overwrite the value of :new.qname_id (qname.qname_id) with the value
  -- obtained from your sequence, before inserting
  :new.id := v_id;
END my_trigger;
/

prompt Loading DQ_META_COLUMN...
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (19, 4, 'SOLD_DATE', 'Date', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (22, null, 'COMPLETED', 'Varchar2(255)', 'Y');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (1, 1, 'ORDERID', 'Number(4)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (2, 1, 'PRICE', 'varchar2(255)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (3, 1, 'CUSTOMER', 'varchar2(255)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (4, 1, 'ORDERDATE', 'date', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (5, 2, 'ORDERITEMID', 'Number(4)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (6, 2, 'ORDERID', 'Number(4)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (7, 2, 'PRODUCT_NAME', 'varchar2(255)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (8, 2, 'QUANTITY', 'Number(4)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (9, 2, 'PAYMENT', 'varchar2(255)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (10, 3, 'ID', 'Number(4)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (12, 3, 'PRICE', 'varchar2(255)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (13, 3, 'ORDERDATE', 'DATE', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (14, 3, 'PRODUCTSTATUS', 'varchar2(255)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (16, 4, 'ORDER_ID', 'Number(4)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (17, 4, 'PRODUCT_NAME', 'varchar2(255)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (18, 4, 'PRODUCT_GROUP_ID', 'Number(4)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (20, 5, 'ID', 'Number(4)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (21, 5, 'PRODUCT_GROUP_NAME', 'varchar2(255)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (11, 3, 'MAIN_ORDERID', 'Number(4)', 'N');
insert into DQ_META_COLUMN (ID, TABLE_ID, NAME, DATATYPE, VARIABLE_YN)
values (15, 4, 'ID', 'Number(4)', 'N');
commit;
prompt 22 records loaded
prompt Loading DQ_META_DENORM_TARGET...
insert into DQ_META_DENORM_TARGET (H3_ID, H3_MAIN_ORDERID, H3_PRICE, H3_ORDERDATE, H3_PRODUCTSTATUS, H4_ID, H4_ORDER_ID, H4_PRODUCT_NAME, H4_PRODUCT_GROUP_ID, H4_SOLD_DATE, H5_ID, H5_PRODUCT_GROUP_NAME)
values ('##H3_ID##138208', '1', '100 EUR', '04-MAR-13', 'COMPLETED', '##H4_ID##85387', '##H3_ID##138208', 'Walkman', '##H4_PRODUCT_GROUP_ID##85387', '04-MAR-13', '##H4_PRODUCT_GROUP_ID##85387', '##H5_PRODUCT_GROUP_NAME##82311');
insert into DQ_META_DENORM_TARGET (H3_ID, H3_MAIN_ORDERID, H3_PRICE, H3_ORDERDATE, H3_PRODUCTSTATUS, H4_ID, H4_ORDER_ID, H4_PRODUCT_NAME, H4_PRODUCT_GROUP_ID, H4_SOLD_DATE, H5_ID, H5_PRODUCT_GROUP_NAME)
values ('##H3_ID##106789', '1', '100 EUR', '04-MAR-13', 'COMPLETED', '##H4_ID##111680', '##H3_ID##106789', 'MP3 Player', '##H4_PRODUCT_GROUP_ID##111680', '04-MAR-13', '##H4_PRODUCT_GROUP_ID##111680', '##H5_PRODUCT_GROUP_NAME##26906');
commit;
prompt 2 records loaded
prompt Loading DQ_META_DEPENDENCY...
insert into DQ_META_DEPENDENCY (ID, NAME, AUTHOR, CREATIONDATE, TYPE_ID, ORDER_ID)
values (3, 'DQ CHECK 3', 'JJO', to_date('03-08-2013', 'dd-mm-yyyy'), 2, 2);
insert into DQ_META_DEPENDENCY (ID, NAME, AUTHOR, CREATIONDATE, TYPE_ID, ORDER_ID)
values (4, 'DQ CHECK 4', 'JJO', to_date('30-03-2013', 'dd-mm-yyyy'), 2, 4);
insert into DQ_META_DEPENDENCY (ID, NAME, AUTHOR, CREATIONDATE, TYPE_ID, ORDER_ID)
values (1, 'DQ CHECK 1', 'JJO', to_date('27-02-2013', 'dd-mm-yyyy'), 1, 1);
insert into DQ_META_DEPENDENCY (ID, NAME, AUTHOR, CREATIONDATE, TYPE_ID, ORDER_ID)
values (2, 'DQ CHECK 2', 'JJO', to_date('30-03-2013', 'dd-mm-yyyy'), 1, 3);
commit;
prompt 4 records loaded
prompt Loading DQ_META_DEPENDENCY_TYPE...
insert into DQ_META_DEPENDENCY_TYPE (ID, NAME)
values (1, 'SOURCETOTARGET');
insert into DQ_META_DEPENDENCY_TYPE (ID, NAME)
values (2, 'TARGET');
commit;
prompt 2 records loaded
prompt Loading DQ_META_DEP_COL_ASSIGN...
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (15, 19, 2, 2, 6);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (18, 10, 2, 2, 5);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (19, 16, 2, 2, 6);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (20, 10, 4, 1, 9);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (21, 10, 4, 2, 11);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (22, 22, 4, 1, null);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (23, 14, 4, 2, 11);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (24, 11, 4, 1, 9);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (25, 11, 4, 2, 11);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (26, 12, 4, 1, 9);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (27, 12, 4, 2, 11);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (28, 13, 4, 1, 9);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (29, 13, 4, 2, 11);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (17, 20, 3, 2, 8);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (1, 1, 1, 1, 1);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (2, 2, 1, 1, 1);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (3, 4, 1, 1, 1);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (4, 11, 1, 2, 2);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (5, 12, 1, 2, 2);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (6, 13, 1, 2, 2);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (7, 1, 2, 1, 3);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (8, 2, 2, 1, 3);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (9, 4, 2, 1, 3);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (10, 7, 2, 1, 4);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (11, 11, 2, 2, 5);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (12, 12, 2, 2, 5);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (13, 13, 2, 2, 5);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (14, 17, 2, 2, 6);
insert into DQ_META_DEP_COL_ASSIGN (ID, COLUMN_ID, DEPENDENCY_ID, SITE_ID, DEP_TABLE_ID)
values (16, 18, 3, 1, 7);
commit;
prompt 29 records loaded
prompt Loading DQ_META_DEP_COL_JOIN_ASSIGN...
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (8, 9, 15);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (10, 18, 19);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (11, 20, 21);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (12, 22, 23);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (13, 24, 25);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (14, 26, 27);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (15, 28, 29);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (1, 1, 4);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (2, 2, 5);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (3, 3, 6);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (4, 7, 11);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (5, 8, 12);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (6, 9, 13);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (7, 10, 14);
insert into DQ_META_DEP_COL_JOIN_ASSIGN (ID, SOURCE_COLUMN_ID, TARGET_COLUMN_ID)
values (9, 16, 17);
commit;
prompt 15 records loaded
prompt Loading DQ_META_DEP_ITER_ASSIGN...
prompt Loading DQ_META_DEP_TAB_ASSIGN...
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (9, 3, 4, 1);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (10, 4, 4, 1);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (11, 3, 4, 2);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (3, 1, 2, 1);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (4, 2, 2, 1);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (1, 1, 1, 1);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (2, 3, 1, 2);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (5, 3, 2, 2);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (6, 4, 2, 2);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (7, 4, 3, 1);
insert into DQ_META_DEP_TAB_ASSIGN (ID, TABLE_ID, DEPENDENCY_ID, SITE_ID)
values (8, 5, 3, 2);
commit;
prompt 11 records loaded
prompt Loading DQ_META_DEP_TAB_JOIN_ASSIGN...
insert into DQ_META_DEP_TAB_JOIN_ASSIGN (ID, PRIMARY_TABLE_ID, SECONDARY_TABLE_ID, PRIMARY_TABLE_COLUMN_ID, SECONDARY_TABLE_COLUMN_ID)
values (3, 9, 10, 10, 16);
insert into DQ_META_DEP_TAB_JOIN_ASSIGN (ID, PRIMARY_TABLE_ID, SECONDARY_TABLE_ID, PRIMARY_TABLE_COLUMN_ID, SECONDARY_TABLE_COLUMN_ID)
values (1, 3, 4, 1, 6);
insert into DQ_META_DEP_TAB_JOIN_ASSIGN (ID, PRIMARY_TABLE_ID, SECONDARY_TABLE_ID, PRIMARY_TABLE_COLUMN_ID, SECONDARY_TABLE_COLUMN_ID)
values (2, 5, 6, 10, 16);
commit;
prompt 3 records loaded
prompt Loading DQ_META_RUN...

prompt Loading DQ_META_SCHEMA...
insert into DQ_META_SCHEMA (ID, NAME, DATATYPE)
values (1, 'SOURCE SCHEMA', null);
insert into DQ_META_SCHEMA (ID, NAME, DATATYPE)
values (2, 'TARGET SCHEMA', null);
commit;
prompt 2 records loaded
prompt Loading DQ_META_SITE...
insert into DQ_META_SITE (ID, NAME)
values (1, 'LEFT');
insert into DQ_META_SITE (ID, NAME)
values (2, 'RIGHT');
commit;
prompt 2 records loaded
prompt Loading DQ_META_TABLE...
insert into DQ_META_TABLE (SCHEMA_ID, NAME, ID, PRIMARY)
values (1, 'S_ORDER', 1, 'Y');
insert into DQ_META_TABLE (SCHEMA_ID, NAME, ID, PRIMARY)
values (1, 'S_ORDER_DETAILS', 2, null);
insert into DQ_META_TABLE (SCHEMA_ID, NAME, ID, PRIMARY)
values (2, 'T_FACT_ORDER', 3, 'Y');
insert into DQ_META_TABLE (SCHEMA_ID, NAME, ID, PRIMARY)
values (2, 'T_DIM_PRODUCT', 4, null);
insert into DQ_META_TABLE (SCHEMA_ID, NAME, ID, PRIMARY)
values (2, 'T_DIM_PRODUCTGROUP', 5, null);
commit;
prompt 5 records loaded
prompt Loading DQ_META_TARGET_STAR_JOIN...
insert into DQ_META_TARGET_STAR_JOIN (ID, PRIMARY_TABLE_ID, SECONDARY_TABLE_ID, PRIMARY_TABLE_COLUMN_ID, SECONDARY_TABLE_COLUMN_ID, ORDER_ID)
values (null, 3, 4, 10, 16, 1);
insert into DQ_META_TARGET_STAR_JOIN (ID, PRIMARY_TABLE_ID, SECONDARY_TABLE_ID, PRIMARY_TABLE_COLUMN_ID, SECONDARY_TABLE_COLUMN_ID, ORDER_ID)
values (null, 4, 5, 18, 20, 3);
commit;
prompt 2 records loaded
prompt Loading DQ_META_VARIABLE...
insert into DQ_META_VARIABLE (ID, VALUE, DATATYPE)
values (1, 'COMPLETED', 'varchar2(255)');
commit;
prompt 1 records loaded
prompt Loading S_ORDER...
insert into S_ORDER (ORDERID, PRICE, CUSTOMER, ORDERDATE)
values (1, '100 EUR', 'University', to_date('04-03-2013', 'dd-mm-yyyy'));
commit;
prompt 1 records loaded
prompt Loading S_ORDER_DETAILS...
insert into S_ORDER_DETAILS (ORDERITEMID, ORDERID, PRODUCT_NAME, QUANTITY, PAYMENT)
values (1, 1, 'Walkman', 2, 'VISA');
insert into S_ORDER_DETAILS (ORDERITEMID, ORDERID, PRODUCT_NAME, QUANTITY, PAYMENT)
values (2, 1, 'MP3 Player', 1, 'CASH');
commit;
prompt 2 records loaded
prompt Loading T_DIM_PRODUCT...
insert into T_DIM_PRODUCT (DQ_META_ID, SOLD_DATE, ORDER_ID, PRODUCT_NAME, PRODUCT_GROUP_ID, ID)
values (null, to_date('04-03-2013', 'dd-mm-yyyy'), 1, 'Walkman', 1, 1);
insert into T_DIM_PRODUCT (DQ_META_ID, SOLD_DATE, ORDER_ID, PRODUCT_NAME, PRODUCT_GROUP_ID, ID)
values (null, to_date('04-03-2013', 'dd-mm-yyyy'), 1, 'MP3 Player', 1, 2);
insert into T_DIM_PRODUCT (DQ_META_ID, SOLD_DATE, ORDER_ID, PRODUCT_NAME, PRODUCT_GROUP_ID, ID)
values (null, to_date('05-03-2013', 'dd-mm-yyyy'), 1, 'Walkman', 1, 3);
commit;
prompt 3 records loaded
prompt Loading T_DIM_PRODUCTGROUP...
insert into T_DIM_PRODUCTGROUP (DQ_META_ID, ID, PRODUCT_GROUP_NAME)
values (null, 1, 'PG1');
commit;
prompt 1 records loaded
prompt Loading T_FACT_ORDER...
insert into T_FACT_ORDER (DQ_META_ID, ID, PRICE, ORDERDATE, PRODUCTSTATUS, MAIN_ORDERID)
values (null, 1, '100 EUR', to_date('04-03-2013', 'dd-mm-yyyy'), 'COMPLETED', 1);
commit;
prompt 1 records loaded
set feedback on
set define on
prompt Done.
